﻿<%@ Page Language="C#" MasterPageFile="~/LTR/MlyLtrMaster.Master" AutoEventWireup="true"
    CodeBehind="ClientaddWoFrm.aspx.cs" Inherits="MLY.LTR.Clients.ClientaddWoFrm"
    Title='<%$Dict:clientAddWofrm.Title%>' %>

<%@ Register Src="~/UserControls/StyledUpDown.ascx" TagName="styledUpDown" TagPrefix="uc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="title" ContentPlaceHolderID="titleHolder" runat="server">
    <title>
        <asp:Literal ID="Literal21" Text='<%$Dict:Titles.clientAddWoTitle%>' runat="server"></asp:Literal>
    </title>
    <style type="text/css">
        .downImage
        {
            margin-top: 5px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:DropDownList runat="server" ID="orgNameRelations" Visible="false" DataSourceID="ObjectDataSource1">
    </asp:DropDownList>
    <center>
        <asp:Label ID="ErrMsg" runat="server" ForeColor="Red" Font-Bold="true"></asp:Label>
        <asp:Label ID="SuccessMsg" runat="server" ForeColor="Green" Font-Bold="true">
            <asp:Literal runat="server" ID="myLit" Text='<%$Dict:clientAddWo.MessageSucceeded%>'
                Visible="false"></asp:Literal>
        </asp:Label>
    </center>
    <asp:FormView ID="workOrderFrm" EnableViewState="false" Width="100%" runat="server"
        DataKeyNames="WorkOrderId" DataSourceID="LinqDataSource1" CssClass="blueTxtBox"
        DefaultMode="Insert" OnItemInserting="workOrderFrm_ItemInserting">
        <InsertItemTemplate>
            <asp:Panel ID="insertPanel" runat="server">
                <table style="width: 100%;" class="addWoFrmCls">
                    <tr>
                        <td style="width: 175px;">
                            <asp:Literal ID="Literal1" runat="server" Text="<%$Dict:clientAddWo.ContractorId%>" />
                        </td>
                        <td style="width: 169px;" id="win-xp">
                            <asp:DropDownList ID="CustomerIdDdl" runat="server" DataSourceID="ObjectDataSource1"
                                CssClass="filterDdl" DataTextField="OrganizationName" DataValueField="OrganizationId">
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                                SelectMethod="GetContractorsByClientId" TypeName="MLY.Bll.clsOrganization">
                                <SelectParameters>
                                    <asp:SessionParameter Name="clientId" SessionField="OrganizationId" Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </td>
                        <td style="width: 300px;">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal2" runat="server" Text="<%$Dict:clientAddWo.contractorWoNum%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="ContractorWorkOrderNumberTextBox" runat="server" Enabled="false"
                                Text='<%# Bind("ContractorWorkOrderNumber") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal3" runat="server" Text="<%$Dict:clientAddWo.CustomerWorkOrderNumber%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="CustomerWorkOrderNumberTextBox" runat="server" Text='<%# Bind("CustomerWorkOrderNumber") %>' />
                        </td>
                        <td>
                            <KBMValidators:requiredValidator ID="RequiredValidator1" runat="server" ControlToValidate="CustomerWorkOrderNumberTextBox"></KBMValidators:requiredValidator>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal4" runat="server" Text="<%$Dict:clientAddWo.LotNumber%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="ContractorLotNumberTextBox" runat="server" Text='<%# Bind("ContractorLotNumber") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal5" runat="server" Text="<%$Dict:clientAddWo.SendDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="SendDateTextBox" runat="server" Text='<%# Bind("SendDate") %>' />
                        </td>
                        <td>
                            <KBMValidators:PastOnlyDateValidator ID="PastOnlyDateValidator1" ControlToValidate="SendDateTextBox"
                                runat="server"></KBMValidators:PastOnlyDateValidator>
                            <KBMControls:KbmCalendar runat="server" TargetControlID="SendDateTextBox" defaultToToday="true"
                                ID="sendDateCalendar">
                            </KBMControls:KbmCalendar>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal6" runat="server" Text="<%$Dict:clientAddWo.RequestedDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="RequestedDelivaryDateTextBox" runat="server" Text='<%# Bind("RequestedDelivaryDate") %>'></asp:TextBox>
                        </td>
                        <td>
                            <KBMValidators:BiggerThenEqualDateValidator ID="BiggerThenEqualDateValidator1" ControlToCompare="SendDateTextBox"
                                ControlToValidate="RequestedDelivaryDateTextBox" runat="server"></KBMValidators:BiggerThenEqualDateValidator>
                            <KBMControls:KbmCalendar runat="server" TargetControlID="RequestedDelivaryDateTextBox"
                                ID="KbmCalendar1">
                            </KBMControls:KbmCalendar>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal7" runat="server" Text="<%$Dict:clientAddWo.PlannedDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="PlannedDelivaryDateTextBox" runat="server" Text='<%# Bind("PlannedDelivaryDate") %>'
                                Enabled="false" />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal8" runat="server" Text="<%$Dict:clientAddWo.ActualDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="ActualDelivaryDateTextBox" runat="server" Text='<%# Bind("ActualDelivaryDate") %>'
                                Enabled="false" />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal9" runat="server" Text="<%$Dict:clientAddWo.CustomerPriority%>" />
                        </td>
                        <td>
                            <uc:styledUpDown DoubleDigit="true" isRequired="true" runat="server" ID="StyledUpDown1"
                                Text='<%# Bind("CustomerPriority") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal10" runat="server" Text="<%$Dict:clientAddWo.Quantity%>" />
                        </td>
                        <td>
                            <uc:styledUpDown isRequired="true" runat="server" ID="QuantityTextBox" Text='<%# Bind("Quantity") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal11" runat="server" Text="<%$Dict:clientAddWo.CustomerCatalougeCode%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="CustomerCatalougeCodeTextBox" runat="server" Text='<%# Bind("CustomerCatalougeCode") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal17" runat="server" Text="<%$Dict:clientAddWo.ContractorCatalougeCode%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ContractorCatalougeCode") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal12" runat="server" Text="<%$Dict:clientAddWo.ProductDescription%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="ProductDescriptionTextBox" runat="server" Text='<%# Bind("ProductDescription") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal13" runat="server" Text="<%$Dict:clientAddWo.TextFieldA%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextFieldATextBox" runat="server" Text='<%# Bind("TextFieldA") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal14" runat="server" Text="<%$Dict:clientAddWo.TextFieldB%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextFieldBTextBox" runat="server" Text='<%# Bind("TextFieldB") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal22" runat="server" Text="<%$Dict:TextFieldC%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextFieldCTextBox" runat="server" Text='<%# Bind("TextFieldC") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal15" runat="server" Text="<%$Dict:clientAddWo.Remarks%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="RemarksTextBox" runat="server" Text='<%# Bind("Remarks") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal16" runat="server" Text="<%$Dict:clientAddWo.OrderNumber%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="OrderNumberTextBox" runat="server" Text='<%# Bind("OrderNumber") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal18" runat="server" Text="<%$Dict:clientAddWo.DateFieldA%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtDateFieldA" runat="server" Text='<%# Bind("DateFieldA") %>'></asp:TextBox>
                        </td>
                        <td>
                            <KBMValidators:DateValidator ID="DateValidator2" ControlToValidate="txtDateFieldA"
                                runat="server" />
                            <KBMControls:KbmCalendar runat="server" TargetControlID="txtDateFieldA" ID="KbmCalendar2">
                            </KBMControls:KbmCalendar>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal19" runat="server" Text="<%$Dict:clientAddWo.DateFieldB%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtDateFieldB" runat="server" Text='<%# Bind("DateFieldB") %>'></asp:TextBox>
                        </td>
                        <td>
                            <KBMValidators:DateValidator ID="DateValidator1" ControlToValidate="txtDateFieldB"
                                runat="server" />
                            <KBMControls:KbmCalendar runat="server" TargetControlID="txtDateFieldB" ID="KbmCalendar3">
                            </KBMControls:KbmCalendar>
                        </td>
                    </tr>
                </table>
                <table class="bottomBtnsCls" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width: 82px;">
                            <asp:ImageButton ID="btnClose" align="middle" Width="13" Height="13" runat="server"
                                ImageUrl="~/Images/add_wo/close_icon.png" CausesValidation="false" OnClick="goBckBtn_Click" />&nbsp
                            <asp:Literal ID="Literal20" runat="server" Text='<%$Dict:clientAddWo.Close %>' />
                        </td>
                        <td>
                            <asp:ImageButton ID="btnSave" align="middle" runat="server" Width="13" Height="13"
                                ImageUrl="~/Images/add_wo/save_icon.png" CommandName="Insert" CausesValidation="true" />
                            &nbsp
                            <asp:Literal ID="Litearl1" runat="server" Text='<%$Dict:clientAddWo.Save %>' />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </InsertItemTemplate>
    </asp:FormView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" EnableInsert="true" ContextTypeName="MLY.Dal.lqKbmDataContext"
        TableName="TableWorkOrders">
    </asp:LinqDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetContractorsByClientId" TypeName="MLY.Bll.clsOrganization">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="" Name="clientId" SessionField="OrganizationId"
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
